<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link type="text/css" rel="stylesheet" href="/css/style.css?t={{time()}}" />
    <script src="/js/jquery.min.js" type="text/javascript"></script>
    <title>厦门佰翔五通酒店康体中心</title>
</head>
<body>
<div class="conent">
	<div class="conent_con">
		<div class="title">厦门佰翔五通酒店康体中心</div>
		<div class="time">2023年4月26 12: 00</div>
		<div class="oneCSs">
		    <div class="oneCSs_one">
		        <label>游泳池面积:</label>
		        <span class="conten1">25m*7m</span>
		    </div>
		    <div class="oneCSs_two">
		        <label>游泳池可容纳人数:</label>
		        <span class="conten2">50人</span>
		    </div>
		    <div class="oneCSs_tree">
		        <label>现有人数:</label>
		        <span class="conten3">5人</span>
		    </div>
		</div>
		<div class="oneCSs">
		    <div class="oneCSs_one">
		        <label>泳池余氯:</label>
		        <span class="conten4">0.8</span>
		    </div>
		    <div class="oneCSs_two">
		        <label>浸脚池余氯:</label>
		        <span class="conten5">72</span>
		    </div>
		    <div class="oneCSs_tree">
		        <label>PH值:</label>
		        <span class="conten6">7.5</span>
		    </div>
		</div>
		<div class="oneCSs">
		    <div class="oneCSs_one">
		        <label>水温:</label>
		        <span class="conten7">29°C</span>
		    </div>
		    <div class="oneCSs_two">
		        <label>检测时间:</label>
		        <span class="conten8">10：00</span>
		    </div>
		    <div class="oneCSs_tree">
		        <label>救生员:</label>
		        <span class="conten9">2人</span>
		    </div>
		</div>
	</div>
</div>
</body>
<script>
    // 获取日期
    function getTime() {
        var date = new Date()
        var Month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
        var day = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
        var Hours = date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()
        var Minutes = date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()
        $(".time").text(date.getFullYear() + "年" + Month + "月" + day + "日 " + Hours + ":" + Minutes)
    }

    // 获取数据
    function getData () {
        $.ajax({
            url:"/api/config",
            dataType:"json",
            type:"get",
            async:"true/false",
            data:{},
            success:function(data){
                if(data.code === 0) {
                    var date = new Date()
                    var Hours1 = date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()
                    var Minutes1 = date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()
                    $(".conten1").text(data.data.pool_area)
                    $(".conten2").text(data.data.capacity)
                    $(".conten3").text((parseInt(data.data.people_count) > 0 ? data.data.people_count : 0) + "人")
                    $(".conten4").text(data.data.pool_chlorine)
                    $(".conten5").text(data.data.foot_chlorine)
                    $(".conten6").text(data.data.ph)
                    $(".conten7").text(data.data.water_temperature)
                    $(".conten8").text(data.data.times)
                    $(".conten9").text(data.data.lifeguard_count)
                }
            },
            error:function(){}
        });
    }
    getData()
    var timer1 = setInterval(function () {
        getData()
    },1000*60*5)
    getTime()
    var timer = setInterval(function () {
        getTime()
    },1000)
</script>
</html>
